{*
Change logs
Feb 10, 2011 - First create
Based on http://www.stunicholls.com/menu/jquery-dropline-7.html
Include file all0000.js
*}
<div id="menu">
    <ul id="dropline">
        {assign var=startdepth value=0}
        {foreach name="children" key=key from=$sections item=section}
        {assign var=nextkey value=`$key+1`}
        {assign var=previouskey value=`$key-1`}

        {if $sections[$previouskey]->depth < $section->depth && $smarty.foreach.children.first!=true}
                <ul class="sub">

        {/if}

        {if $section->active == 1 && $section->public==1}
            <li class="{if $section->depth == 0}top{else}yuimenuitem{/if}">
            <a class="{if $section->depth == 0}menu_top{else}menu_sub{/if}" href="{$section->link}">{$section->name}</a>
            {if $sections[$nextkey]->depth == $section->depth}</li>{/if}
        {else }
            {*<li class="yuimenuitem">
                <a class="{if $section->depth == 0}yuimenubaritemlabel{else}yuimenuitemlabel{/if}" href="#">{$section->name}</a>
            {if $sections[$nextkey]->depth == $section->depth}</li>{/if}*}
        {/if}

        {if $sections[$nextkey]->depth < $section->depth}
            {if $smarty.foreach.children.last==true}
                {assign var=nextdepth value=$startdepth}
            {else}
                {assign var=nextdepth value=$sections[$nextkey]->depth}
            {/if}
            {math equation="x-y" x=$section->depth y=$nextdepth assign=looper}
            {section name="close" loop=$looper}
                        </li>
                    </ul>
            {/section}
                </li>
        {/if}

        {/foreach}
        </ul>
    </div>
